package com.android.equipment.adapter

import android.widget.ImageView
import com.android.equipment.R
import com.android.equipment.dao.ConfigModel
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class UpdateConfigAdapter(layoutRes: Int): BaseQuickAdapter<ConfigModel, BaseViewHolder>(layoutRes) {
    override fun convert(holder: BaseViewHolder, item: ConfigModel) {
        holder.setText(R.id.tv_name, "${item.node_des}(${item.node})")
        if (item.is_show == 1){
            holder.getView<ImageView>(R.id.iv_sel).setImageResource(R.mipmap.icon_circle_sel)
        }else {
            holder.getView<ImageView>(R.id.iv_sel).setImageResource(R.mipmap.icon_circle_nor)
        }
    }
}